In the previous examples, we saw that we could merge
branches directly into the master branch by first checking out to master
and then merging them. When you're working with a team, however, you usually
don't want to do this. Instead, we can do all of this
on a platform like GitHub. In order to push the
latest change to GitHub, we'll push to the
origin Sarah branch by typing git push origin Sarah. After pushing to
the Sarah branch and checking out
the GitHub repo, you'll see a pop-up
that shows that the master branch is now one commit behind
the Sarah branch. In order to merge
Sarah into Master, we'll have to open something
called a pull request. We can do that by clicking
the "Pull request" button in the top bar or the pull request button
shown in this pop-up. Once we've clicked
on that button, you'll see the changes
that were made to the Sarah branch compared
to the master branch, and a button to create
a pull request. Let's create a pull request, also called a PR. We can add additional
information about the changes
that we've made, such as a title
and a description, maybe some important labels, or add specific reviewers
for this pull request. Now that the pool
request has been opened, other team members can see the changes that you've
made and comments on them. If everything has been approved, you can merge your changes into master by clicking the
"Merge pull request" button. Perfect. Instead
of checking out to master locally and
merging it that way, we've just merged
our changes into master by creating
a pull request, merging it on GitHub. The origin Sarah branch has now been merged into the
origin master branch. To make sure that not anyone can just merge changes into
the master branch, you need to have the right
privileges to do so. This is the default if
it's your own repo, but if you're working
in a larger team, you may need to ask
other team members to merge the PR for you.